﻿using System;

namespace ToyChat
{
    /// <summary>
    /// This interface describes a user interface pane in toychat
    /// </summary>
    public interface IPane
    {
        /// <summary>
        /// Called from the user interface when the pane has been added
        /// </summary>
        /// <param name="ui">A reference to the <see cref="IUserInterface"/> that contains this pane</param>
        void Initialize(IUserInterface ui);

        /// <summary>
        /// Gets or Sets the title of the pane
        /// </summary>
        string Title { get; set; }

        /// <summary>
        /// Should be fired when the title has changed and needs updating
        /// </summary>
        event Action<string> TitleChanged;

        /// <summary>
        /// Closes the pane
        /// </summary>
        void Close();

        /// <summary>
        /// Gets a value indicating whether or not this pane "can" be closed
        /// </summary>
        bool Closeable { get; }
    }
}